<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['shopset']=plugin('jy_weishop')->plugin_setting('shopset');
	$return['params']=array();
	if($_RQ['pid']){
		$return['pid']=$return['oneid']=$_RQ['pid'];
	}else{
		$return['pid']=0;
	}
	$parentid=0;
	$groupspram=array('uniacid'=>$_SESSION['uniacid'],'status'=>1);
	if($parentid){
		$return['pid']=0;
	}
	$category=pdo_getall('jy_msgorder_group',$groupspram,array(),'','paixu desc');
	foreach($category as &$item){
		if(!$return['pid']){			
			$return['pid']=$item['id'];
			$return['nowkey']=0;
			$return['nowchilds']=$item['childs'];
			if(!$parentid){
				$return['params']['pcate']=$return['pid']?:$category[0]['id'];
			}else{
				$return['params']['pcate']=$parentid;
			}
		}
	}
	$searchkeyword=$this->plugin_setting('search')['keyword'];
	$return['searchkeyword']=explode(';',$searchkeyword);
	$return['category']=$category;
	//推荐
	$groupspram['isrecommand']=1;
	$recommend=pdo_getall('jy_msgorder_group',$groupspram);
	$return['recommend']=$recommend;
	$return['sharedata']=array(
		'title'=>$return['setting']['share_title']?'分类'.$return['setting']['share_title']:'分类-咨询专栏',
		'desc'=>$return['setting']['share_desc']?$return['setting']['share_desc']:'咨询专栏，一个属于自己的个人商城！',
		'link'=>custom_url('jy_textfee/shop.groups//fromuser='.$_SESSION['uid'],true),
		'imgUrl'=>ATTACHMENT_URL.$return['setting']['share_image']
	);
	set_html('title','专家分类');
	exi($return);
}
?>